package com.inifitness.tenant.core.system.converter;


import com.inifitness.tenant.core.system.model.entity.BizMenu;
import com.inifitness.tenant.core.system.model.form.BizMenuForm;
import com.inifitness.tenant.core.system.model.vo.BizMenuVO;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 菜单对象转换器
 *
 * @author sunjinfeng
 * @since 2024/04/18 11:00:00
 */
@Mapper(componentModel = "spring")
public interface BizMenuConverter {

  @Mapping(target = "children", ignore = true)
  BizMenuVO entity2Vo(BizMenu entity);

  BizMenuForm entity2Form(BizMenu entity);

  @Mapping(target = "updateTime", ignore = true)
  @Mapping(target = "treePath", ignore = true)
  @Mapping(target = "createTime", ignore = true)
  BizMenu form2Entity(BizMenuForm bizMenuForm);
}